
<template>
  <div class="wrap">
    <div class="top">
      <div class="pledgee-name">
        <span>撤回商标使用许可备案表</span>
      </div>

      <div class="pledgee-msg">
        <div class="top-left">
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">许可人名称（中文）：</span>
              <el-input v-if="control" v-model="allowFromCh" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowFromCh}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model="allowFromEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowFromEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">许可人地址（中文）：</span>
              <el-input v-if="control" v-model="allowFromAddrCh" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowFromAddrCh}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model=" allowFromAddrEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ allowFromAddrEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">被许可人名称（中文）：</span>
              <el-input v-if="control" v-model="allowToCh" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowToCh}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model="allowToEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowToEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">被许可人地址（中文）：</span>
              <el-input v-if="control" v-model="allowToAddrCh" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowToAddrCh}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model="allowToAddrEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{allowToAddrEn}}</span>
            </div>
          </div>
          
          <div class="form-menu" v-if="this.licenseeType==0||this.licenseeType==1">
            <div class="form-menu-left" v-if="this.businessLicense">
              <span class="form-menu-text">被许可人营业执照 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow>
                  <img :src="this.mconfig.host+businessLicense" class="yybox" alt="">
                </imgshow>
              </span>
            </div>
          </div>
          <div class="form-menu" v-if="this.licenseeType==9">
            <div class="form-menu-left" v-if="this.businessLicense">
              <span class="form-menu-text">被许可人其它证件 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow>
                  <img :src="this.mconfig.host+businessLicense" class="yybox" alt="">
                </imgshow>
              </span>
            </div>
          </div>
          <div class="form-menu" id="sfz1" v-if="this.iddbimage">
            <div class="form-menu-left">
              <span class="form-menu-text">被许可人身份证正反面 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow>
                  <img :src="this.mconfig.host+iddbimage" class="yy1box" alt="">
                </imgshow>
              </span>
            </div>
          </div>

          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮政编码 ：</span>
              <el-input v-if="control" v-model="postCode" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{postCode}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">联系人 ：</span>
              <el-input v-if="control" v-model="contact" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{contact}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮箱 ：</span>
              <el-input v-if="control" v-model="email" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{email}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">电话 ：</span>
              <el-input v-if="control" v-model="phone" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{phone}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">代理机构名称 ：</span>
              <el-input v-if="control" v-model="deptName" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{deptName}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">商标注册号 ：</span>
              <el-input v-if="control" v-model="appNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNum}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">原使用许可备案申请号 ：</span>
              <el-input v-if="control" v-model="registNumOri" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{registNumOri}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">是否共有商标 ：</span>
              <!-- <div v-if="control" style="width:100%;padding-left:30px">
                <el-radio v-model="isComm" :label="1">是</el-radio>
                <el-radio v-model="isComm" :label="0">否</el-radio>
              </div> -->
              <span class="parallelism">
                <span v-show="isComm==1">是</span>
                <span v-show="isComm !=1">否</span>
              </span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">撤回理由 ：</span>
              <el-input
                v-if="control"
                type="textarea"
                show-word-limit
                maxlength="100"
                :rows="20"
                placeholder="请输入内容"
                v-model="withdrawReason"
              ></el-input>
              <span class="parallelism" v-else >
                {{withdrawReason}}
              </span>
            </div>
          </div>


          


          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">营业执照 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow>
                  <img :src="this.mconfig.host+busimg" class="yybox" alt="">
                </imgshow>
              </span>
            </div>
          </div>
          <div class="form-menu" id="sfz1" v-if="this.idcardimg !== ''">
            <div class="form-menu-left">
              <span class="form-menu-text">身份证正反照 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow>
                  <img :src="this.mconfig.host+idcardimg" class="yy1box" alt="">
                </imgshow>
              </span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">网上确认书 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow>
                  <img :src="this.mconfig.host+qrfile" class="yybox" alt="">
                </imgshow>
              </span>
            </div>
          </div>

          <!--<div class="form-menu" v-if="otherfile != []">-->
          <div class="form-menu" v-if="otherfile.length>0">
            <div class="form-menu-left">
              <span class="form-menu-text">其他附件 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <imgshow v-for="(item,index) in otherfile" :key="index">
                  <img :src="mconfig.host+item" class="yybox" alt="">
                </imgshow>
              </span>
            </div>
          </div>

        </div>
      </div>
    </div>

    <!-- <div class="follower" v-if="isComm==1? true:false">
      <div class="follower-title">
        <div>
          <div>撤回商标使用许可备案表</div>
          <div>（附页）</div>
        </div>
        <span class="follower-title-text">其他共有许可人</span>
      </div>

      <div class="follower-matter">
        <div v-if="proAppendJson.length">
          <el-form
            ref="otherJson"
            :model="otherJson"
            class="model-form"
            label-width="120px"
            size="small"
          >
            <div v-for="(item,index) in proAppendJson" :key="index">
              <el-row>
                <el-col :span="12" :offset="12">
                  <el-form-item :label="index+1 +'.名称(中文) :'">
          
                    <span>{{item.partNameCh}}</span>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12" >
                  <el-form-item label="(英文) :">

                    <span>{{item.partNameEn}}</span>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="地址(中文) :">

                    <span>{{item.partAddrCh}}</span>
                  </el-form-item>
                </el-col>
                <el-col :span="10" style="text-align:right">
                  <span class="signature">（章戳/签字）</span>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="(英文) :">

                    <span>{{item.partAddrEn}}</span>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </el-form>
        </div>
      </div>
    </div> -->

    <div class="follower">
            <div class="follower-title">
                <div>
                    <div class=" text-align: right;">撤回商标使用许可备案表</div>
                    <div class=" text-align: center;" style="margin-left:85px">（附页）</div>
                </div>
                <span class="follower-title-text"  style="margin-left:50px">其他共同申请人名称列表</span>
            </div>
            <proAppend class="part" :callback="proAppendJson"></proAppend>
            <!-- <div class="follower-matter">
                <div class="follower-matter-frame" v-for="(mat,ter) in proAppendJson" :key="ter">
                    <div>
                        <div class="follower-matter-text"><span style="width:320px;display: inline-block;text-align: right;">{{ter+1}}. 名称（中文）：</span><span style="margin-left: 10px;">{{mat.partNameCh}}</span></div>
                        <div class="follower-matter-text"><span style="width:320px;display: inline-block;text-align: right;">名称（英文）：</span><span style="margin-left: 10px;">{{mat.partNameEn}}</span></div>
                        <div class="follower-matter-text"><span style="width:320px;display: inline-block;text-align: right;">地址（中文）：</span><span style="margin-left: 10px;">{{mat.partAddrCh}}</span></div>
                        <div class="follower-matter-text"><span style="width:320px;display: inline-block;text-align: right;">地址（英文）：</span><span style="margin-left: 10px;">{{mat.partAddrEn}}</span></div>
                    </div>
                    <div class="seal">（戳章/签字）</div>
                </div>
            </div> -->
        </div>

    

    <!-- <div class="botton" style="width:100%;text-align:center;padding:15px 0;">
            <a class="buttona" href="javascript:;" @click="submit()">提交</a>
    </div>-->

    <!-- <div class="amend-btn">
          <a class="buttona" href="javascript:;" @click="notarizeAmend">确认修改</a>
    </div>-->
    
  </div>
</template>

<script>
import proAppend from "../common/proAppend"
import imgshow from "../common/imgshow"
export default {
  components:{
        imgshow,
        proAppend
    },
  data() {
    return {
      deptName:'',
      ageName: "", //  代理机构名称
      appNum: "", //   商标注册号
      appliType: "", //   申请人类型
      allowToCh: "", //   被许可人名称（中文）
      allowToAddrCh: "", //被许可认地址（中文）
      allowToAddrEn: "", //  被许可人地址（英文）
      allowToEn: "", //   被许可人名称（英文）
      branchNetworkId: "", //   网点编号
      contact: "", //   联系人
      email:"",//电子邮件
      id: "",
      busimg:'',  
      sfz:'', 
      Lastname:'',
      idcardimg:'',
      otherfile:[],
      qrfile:'',
      iddbimage:"",//身份证反面
      licenseeType:"",//证件类型
      businessLicense:"",// 被许可人营业执照
      iDCard:"",  //被许可人身份证
      imgPath: [
        {
          url:
            "http://api_devs.wanxikeji.cn/app/pic/20200811/20200811014058945.jpg",
        },
        {
          url:
            "http://api_devs.wanxikeji.cn/app/pic/20200811/20200811013904718.jpg",
        },
      ], //   图片地址
      isComm: "", //   是否共有商标
      allowFromCh: "", //   许可人地址（中文）
      allowFromEn: "", //   许可人地址（英文）
      allowFromAddrCh: "", //   许可人名称（中文）
      allowFromAddrEn: "", //   许可人名称（英文）
      phone: "", //   电话
      postCode: "", //   邮政编码
      registNumOri: "", //   原使用许可备案申请号
      subStatus: "", //   状态
      userId: "", //   用户id
      withdrawReason: "", //   撤回理由

      control: false, //   控制标签的显示
      options: [
        { value: 0, label: "企业" },
        { value: 1, label: "个人" },
      ],
      optionss: [
        { value: 1, label: "保存" },
        { value: 2, label: "通过" },
        { value: 3, label: "未通过" },
        { value: 4, label: "未审核" },
      ],
      dialogVisible: false,
      disabledd: false,
      check_box: false,

      appliTypee: "", //   申请类型(页面展示)
      isComms: "", //   是否共有商标的文本部分(页面展示)
      subStatuss: "", //   状态(页面展示)

      proAppendJson: [],
      otherJson: {},  // 可编辑，这里没用
    };
  },
  methods: {
    genre() {
      ////console.log(this.appliType);
    },
    notarizeAmend() {
      if (this.control) {
        this.control = false;
        ////console.log(this.control);
      } else {
        this.control = true;
        ////console.log(this.control);
      }
    },
    handleExceed(files, fileList) {
      //   图片地址
      this.disabledd = true;
      let a = "http://api_devs.wanxikeji.cn/" + files.data;
      this.imgPath.push(a);
      // ////console.log(this.imgPath)
    },
    handlePictureCardPreview(file) {
      //  上传图片的放大显示
      this.imgPath = file.url;
      this.dialogVisible = true;
      //  ////console.log('www',file)
    },
    handleRemove(file) {
      //  上传图片的删除
      ////console.log(file);
      this.disabledd = false;
      this.$refs.upload.clearFiles();
    },
    submit() {
      //   按钮提交的值得获取

      ////console.log(this.appliType, this.isComm, this.subStatus);
    },
    add(val) {
      this.$http
        .get("/trademark/proWoafrotr/findByIdDetl", {
          params: {
            id: val,
          },
        })
        .then((res) => {
          console.log(res)
          let resData = res.data.data.data;
          let resAppend = res.data.data.append;

          this.allowFromCh = resData.allowFromCh || resData.appName      //   许可人名称（中文）
          this.allowFromEn = resData.allowFromEn || resData.appNameEn    //  许可人名称（英文）
          this.allowFromAddrCh = resData.allowFromAddrCh || resData.busAddress   //  许可人地址（中文）
          this.allowFromAddrEn = resData.allowFromAddrEn || resData.appAddEn   //  许可人地址（英文）

          this.allowToCh = resData.allowToCh          //   被许可人名称（中文）
          this.allowToEn = resData.allowToEn         //   被许可人名称（英文）
          this.allowToAddrCh = resData.allowToAddrCh   //   被许可人地址（中文）
          this.allowToAddrEn = resData.allowToAddrEn    //   被许可人地址（英文）
          this.email = resData.email               //电子邮件
          this.postCode = resData.postCode                  //  邮政编码       
          this.contact = resData.contact                     //  联系人 
          this.phone = resData.phone                         //  电话
          this.ageName = resData.agent                       //  代理机构
          this.appNum = resData.registNum                    //  商标注册号
          this.registNumOri = resData.registNumOri           //  许可备案申请
          this.isComm = JSON.parse(resData.share)              //  是否共有商标
          this.withdrawReason = resData.reasonsWithdrawal    //  撤回理由
          this.deptName = resData.deptName  
          this.busimg = res.data.data.data.busimg
          this.proAppendJson = resAppend  
          this.idcardimg=res.data.data.data.idcardimg
          this.qrfile = res.data.data.data.qrfile
          this.otherfile = JSON.parse(resData.otherfile)
          
          this.iddbimage = res.data.data.data.iddbimage    //被许可人身份证正反面
          this.businessLicense = res.data.data.data.businessLicense    //被许可人营业执照
          this.licenseeType = res.data.data.data.licenseeType    //被许可人类型
          // this.iDCard = res.data.data.data.iDCard     //被许可人身份证
          this.Lastname = res.data.data.append          //   共有人
          this.sfz = res.data.data.data.appliType
          // this.xians();
        });
    },
    // xians(){
    //       console.log(this.proAppendJson[0].partNameCh)
    //       console.log(this.sfz)
    //       var follower = document.querySelector('.follower')
    //       var sfz1 = document.querySelector('#sfz1')
    //       if(this.sfz){
    //           sfz1.style.display="block"
    //       }else{
    //           sfz1.style.display="none"
    //       }
    //       if(this.proAppendJson[0].partNameCh){
    //           follower.style.display="block"
    //       }else{
    //           follower.style.display="none"
    //       }
    // }
  },
  watch: {
    control(val) {
      
      if (val) {
        return true;
      } else {
        if (this.appliType == 0) {
          this.appliTypee = "企业";
        } else if (this.appliType == 1) {
          this.appliTypee = "个人";
        }

        if (this.isComm == 1) {
          this.isComms = "是";
        } else if (this.isComm) {
          this.isComms = "否";
        }

        if (this.subStatus == 1) {
          this.subStatuss = "保存";
        } else if (this.subStatus == 2) {
          this.subStatuss = "通过";
        } else if (this.subStatus == 3) {
          this.subStatuss = "未通过";
        } else if (this.subStatus == 4) {
          this.subStatuss = "未审核";
        }
      }
      ////console.log(this.appliType, this.isComm, this.subStatus);
    },
  },
  mounted() {
    let aa = this.$route.query.id
    this.add(aa);
  },
};
</script>


<style scoped>
body,
div,
a,
p,
span,
ul,
li {
  padding: 0;
  margin: 0;
}
div {
  box-sizing: border-box;
}
img {
  max-width: 100%;
  max-height: 100%;
}
a {
  text-decoration: none;
}
.wrap {
  padding: 20px 20px;
  position: relative;
}
.amend-btn {
  position: absolute;
  top: 8%;
  right: 10%;
}
.buttona {
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  background: rgba(0, 0, 255, 0.5);
}
.buttona:hover {
  background: rgba(0, 0, 255, 0.8);
}
.top {
  /* 质权人信息部分  */
  min-width: 1200px;
  /* margin: 0 auto; */
  padding: 10px 5px;

}
.pledgee-name {
  /* 质权人信息部分整体框架  */
  width: 100%;
  
  padding-left: 340px;
  /* flex-direction: row; */
  font-size: 30px;

  /* align-items: center; */
  /* text-align: center; */
}
.dashed-text {
  /* 质权人信息部分的标题  */
  font-size: 17px;
  font-weight: bold;
  color: rgb(100, 100, 100);
}
.dashed {
  /* 质权人信息部分的内容  */
  width: 50%;
  margin-left: 10px;
  border-top: 1px dashed rgb(204, 204, 204);

}
.pledgee-msg {
  /* 内容部分的整体框架  */
  width: 100%;
  display: flex; 
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
}
.top-left {
  /* 内容的左边部分  */
  width: 100%;

  /* border: 1px solid red; */
}
.form-menu {
  /*  每行内容的显示  */
  display: flex;
  flex-direction: row;
  padding: 5px 80px 5px 50px;
  padding: 8px 0;
  text-align: center;

}
.form-menu-left {
  width: 40%;
  display: flex;
  flex-direction: row;
  text-align: left;
  margin-left: 260px;
  
}
.form-menu-right {
  width: 40%;
  display: flex;
  flex-direction: row;
  text-align: left;
  margin-left: 260px;
  
}
.form-menu-text {
  /*  每行内容文本的css样式的显示  */
  width: 320px;
  font-size: 13px;
  /* margin-right: 25px; */
  /* padding-top: 10px; */
  color: rgb(140, 140, 140);
  text-align: right;

}
.parallelism {
  width: 100%;

  margin-left: 10px;
  /* padding: 10.2px 0; */
}
.el-input /deep/ .el-input__inner {
  color: #000;
  height: 38px;
}

.el-select {
  width: 700px;
}
.el-select-dropdown__item {
  padding-left: 20px;
}

/* 新版本样式 */
.stamp {
  width: 30%;
  height: 250px;
  font-size: 15px;
  text-align: center;
  /* border: 1px solid red; */
}
.agent {
  width: 100%;
  text-align: right;
  margin-right: 25%;
}
.follower {
  padding: 50px 0 0 0;
}
.follower-title {
  margin-left: 340px;
  /* font-weight: bold; */
  font-size: 22px;
}
.follower-title-text {
  font-size: 16px;
  font-weight: normal;
  display: inline-block;
  padding: 20px 0 15px 0;
}
.follower-matter-frame {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 20%;
  margin-bottom: 20px;
}
.seal {
  color: rgb(104, 104, 104);
}
.follower-matter-text {
  width: 100%;
  font-size: 15px;
  text-align: left;
  padding: 10px 0px;
  margin-left: 200px;
}
.yybox{
  width: 500px;
}
.yy1box{
  width: 350px;
}
.part{
  margin-left: 267px;
}
</style>